//Derclare variables
var a;
var p;

//create my album collection
var albums = new Array();



//*********Album 1 ***************//

//create the instance of album 1 and name it
var a = new Album("My Album");

//create and add photos to the album
var p = new Photo("Android Honeycomb", "images/thumbs/honeycomb.jpg","images/photos/honeycomb.jpg");
a.addPhoto(p);

var p = new Photo("Android Honeycomb 2", "images/thumbs/honeycomb.jpg","images/photos/honeycomb.jpg");
a.addPhoto(p);

//add my album to the albums collection
albums.push(a);
	
//*********Album 2 ***************//

//create the instance of album 1 and name it
var a = new Album("My Album 2");

//create and add photos to the album
var p = new Photo("Android Honeycomb", "images/thumbs/honeycomb.jpg","images/photos/honeycomb.jpg");
a.addPhoto(p);

var p = new Photo("Android Honeycomb 2", "images/thumbs/honeycomb.jpg","images/photos/honeycomb.jpg");
a.addPhoto(p);

//add my album to the albums collection
albums.push(a);


//test code
alert(albums.length);
//******************* Types ********//
function Album(title){
	this.title = title;
	this.photos = new Array();
	
	this.addPhoto = function(photo){
		this.photos.push(photo);
	} 
}

function Photo(caption,thumb,image){
	
	//properties
	this.caption = caption;
	this.thumb = thumb;
	//methods
	this.addPhoto = function(photo) {
		this.photos.push(photo);
	}
	
	
}
document.getElementById("body").push(photo);